runmake_complete(){
    local cur prev prev_prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORDS-1]}"
    opts="-r --run"
    case "${cur}" in
        - | -- )
            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
            return 0
            ;;
        --r | --ru)
            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
            return 0
            ;;
        *)
            COMPREPLY=( $(compgen -o filenames -W "`ls ../bin/`" -- ${cur}) )
            return 0
            ;;
    esac
    # 这几个变量是bash-completion预定义的变量
    # declare -p COMP_WORDS
    # declare -p COMP_CWORD
    # declare -p COMP_LINE
    # declare -p COMP_WORDBREAKS
}


runmake(){
    # chech args
    echo "==================================================================="
    if [ $# -gt 0 ]; then
        echo -e "\e[1;32m Going to run $* \e[0m"
        run_which=$1
    else
        echo -e "\e[1;32m Specified no executable, runing ALL \e[0m"
        run_which="all"
    fi
    echo "==================================================================="

    # dir=`pwd`
    dir=$(pwd)
    parent=${dir##*/}
    if [ "${parent}" == build ]; then
        echo "==================================================================="
        echo -e "\e[1;32m In *BUILD*, running programs in bin \e[0m"
        echo "==================================================================="
        cd ../bin
    elif [ "${parent}" == bin ]; then
        echo "==================================================================="
        echo -e "\e[1;32m In *BIN*, running programs in bin \e[0m"
        echo "==================================================================="
    else
        echo "==================================================================="
        echo -e "\e[1;31m *UNKOWN PATH*: ${parent}, terminating \e[0m"
        echo "==================================================================="
        return 111
    fi

    # path=`pwd`
    path=$(pwd)
    for file in "${path}"/*; do
        # 如果等于 all， 则运行所有的文件，否则只运行指定的文件
        if [ "${run_which}" == "all" ]; then
            echo ""
